<template>

  <view>
    <u-navbar>扫码结果</u-navbar>
    <view style="width: 100%;height: 85vh;position: relative">
      <view class="res_content">
<!--        resData.code==1?"扫码成功":"扫码失败"-->
        <text class="res_title">{{resData.res}}</text>
        <image class="resImg" :src="src"></image>
        <text class="error_info" v-if="resData.code==0">{{resData.msg}}</text>
      </view>


    </view>
  </view>

</template>

<script>
export default {
  name: "QrResultPage",
  data() {
    return {
      resData: {},
      src: "",
    }
  },
  onLoad(option) {
    this.resData = JSON.parse(decodeURIComponent(option.resData))
    this.src = this.resData.code == 1 ? "/static/images/public/QrResult/success.png" : "/static/images/public/QrResult/error.png"
  },
  methods: {
    back() {
      uni.navigateBack({
        delta: 1
      })

    },
  }
}
</script>

<style scoped>
.resImg {
  display: block;
  width: 360rpx;
  height: 360rpx;
  margin-top: 30rpx;
  margin-bottom: 30rpx;
  margin-right: auto;
  margin-left: auto;
}
.res_title{
  text-align: center;
  font-weight: 600;
  font-size: 36rpx;
  display: block;
}
.error_info{
  text-align: center;
  font-size: 32rpx;
  color: red;
  display: block;
}
.res_content{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 460rpx;
  height: 700rpx;
}
</style>
